package com.loopy.tomcat.servlet;

import com.loopy.tomcat.http.loopyRequest;
import com.loopy.tomcat.http.loopyResponse;

import java.io.IOException;
import java.io.OutputStream;

public class loopyServlet02 extends loopyhttpSevlet {
    @Override
    public void init() throws Exception {

    }

    @Override
    public void destroy() {

    }

    @Override
    public void doGet(loopyRequest request, loopyResponse response) {
        OutputStream outputStream = response.getOutputStream();
        String res=response.resHeader+"<h1>loopyServlet02</h1>";
        try {
            outputStream.write(res.getBytes());
            outputStream.flush();
            outputStream.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public void doPost(loopyRequest request, loopyResponse response) {
        doGet(request, response);
    }
}
